//
//  GlobalDefine.h
//  coldjoke-ios-client
//
//  Created by lai on 13-1-25.
//
//


//--基本参数--
#define SCREEN_WIDTH        [[UIScreen mainScreen] bounds].size.width    //当前设备的屏幕宽度
#define SCREEN_HEIGHT       [[UIScreen mainScreen] bounds].size.height  //当前设备的屏幕高度
#define WINDOW_WIDTH        [ UIScreen mainScreen ].applicationFrame.size.width
#define WINDOW_HEIGHT       [ UIScreen mainScreen ].applicationFrame.size.height
#define PP_RELEASE(xx)      [xx release], xx = nil  //release宏

//--mbprogressHUd的透明度--
#define PP_mbprogressHudOpacity 0.7

//--appKey--
#define SINA_AppKey         @"3391109472"                                   //新浪微博登录key
#define SINA_AppSecret      @"0b68f70fcc258c2aff078084750e0c9b"             //新浪微博登录secret
#define SINA_AppRedirectURI @"http://sns.whalecloud.com/sina2/callback"     //新浪微博登录回调地址
#define UMENG_APPKEY        @"502b550252701547f800003a"                     //友盟KEY
#define WEIXIN_APPKEY       @"wx948d9e6f204c7b6f"                           //微信key

//--文件夹--
#define CACHES_FOLDER           [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"]
#define GIF_PATH_FOLDER         [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches/Gif"]
#define TOPIC_IMAGE_FOLDER      [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches/ImageCache/TopicDetail"]
#define SPLASH_IMAGE_FOLDER    [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches/SplashImage"]
#define SD_CACHES_FOLDER        [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches/ImageCache"]

//--查看是否是wifi--
#define PP_hasWifi                      [[NetWorkManager sharedInstance]hasWifiNetwork]
#define PP_HasNoWifiButLoadImages       NO   //在3g,gprs下加载图片设为yes即可

//--提示文案--
#define PP_loginErrorInfo @"服务器出小差了！稍后再试~"  //登录错误文案

//--无网络提示--
#define HAS_NO_NETWORK(__OWNER__)    \
if (![[NetWorkManager sharedInstance]hasNetwork])\
{ \
[(__OWNER__) baseShowInfoHud:@"网络没有连接,请重试" andIsTop:NO];\
return;\
}\

//--SDWebImage缓存时间--
#define SDWebImageCacheTime 60*60*24*15  //15天

#define userAgentValue  @"lxh_app2_220";

//--ASI的get方法--
#define ASIHttpRequset_GET(url,needSession)    \
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]]; \
request.userAgentString = userAgentValue; \
[request setRequestMethod:@"GET"]; \
[request setAllowCompressedResponse:YES]; \
if (needSession)\
{ \
[request addRequestHeader:@"COOKIE" value:[NSString stringWithFormat:@"webpy_session_id=%@",[UserManager sharedInstance].sessionId] ];  \
}\
[request setDelegate:self]; \
[request startSynchronous]; \


//--ASI的post方法--
#define ASIFormDataRequest_POST(url)      \
ASIFormDataRequest *request=[ASIFormDataRequest requestWithURL:[NSURL URLWithString:url]];   \
request.userAgentString = userAgentValue;  \
[request setAllowCompressedResponse:YES]; \
[request addRequestHeader:@"Cookie" value:[NSString stringWithFormat:@"webpy_session_id=%@",[UserManager sharedInstance].sessionId] ];\



